package com.nineclock.document.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.document.pojo.DocFileHistory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DocFileHistoryMapper extends BaseMapper<DocFileHistory> {
    // 根据文档ID查询文档编辑的历史记录
    @Select("SELECT\n" +
            "`id`,\n" +
            "`file_id`,\n" +
            "`file_name`,\n" +
            "`operate_user_id`,\n" +
            "`operate_time`,\n" +
            "`is_create`,\n" +
            "`content`\n" +
            "FROM\n" +
            "doc_file_history\n" +
            "WHERE file_id = #{fileId}")
    List<DocFileHistory> queryFileHistoryByFileId(@Param("fileId") Long fileId);
}
